import * as React from 'react';
import { RichTextHandler } from '../../components/rich-text/RichTextHandler';
import { VideoPosterPlayIconType } from '../../components/video-poster/VideoPoster';
import { INewsItem } from '../../model/INewsList';
import { OfflineScreenPlace } from '../../screen/offline/OfflineScreen';

interface OwnProps {
    className?: string;
    newsItem?: INewsItem;
    dataUnitId?: string;
    online?: boolean;
    onImageClick?: () => void;
}

interface Props extends OwnProps {}

export const NewsRichTextWithVideo = (props: Props) => {
    const { newsItem, onImageClick, dataUnitId, online, className } = props;

    return (
        <RichTextHandler
            text={newsItem.text}
            videoData={newsItem.videoData}
            linkData={newsItem.linkData}
            className={className}
            customApiAddress={''}
            onImageClick={onImageClick}
            online={online}
            dataUnitId={dataUnitId}
            playIconType={VideoPosterPlayIconType.SEVERSTAL}
            offlineScreenPlace={OfflineScreenPlace.NEWS_LIST_PAGE}
        />
    );
};
